#ifndef POINT2_H_INCLUDED_90293088
#define POINT2_H_INCLUDED_90293088
//-----------------------------------------------------------------------------
// Copyright (c) 2011 David Waby
// Initially created on 31/10/2011
//-----------------------------------------------------------------------------

#include "IJsonSerialisable.h"
  
//-----------------------------------------------------------------------------
class Point2 : public IJsonSerialisable
{
public:
									Point2()
									{
										m_data[X] = 0;
										m_data[Y] = 0;
									}

									Point2(int const x, int const y)
									{
										m_data[X] = x;
										m_data[Y] = y;
									}

									Point2(Point2 const &rhs)
									{
										m_data[X] = rhs[X];
										m_data[Y] = rhs[Y];
									}

	virtual							~Point2()
									{
									}

	Point2&							operator= (Point2 const &rhs)
									{
										if (this == &rhs)
											return *this;

										m_data[X] = rhs[X];
										m_data[Y] = rhs[Y];
										return *this;
									}

	int								operator[] (int const index) const
									{
										return m_data[index];
									}

	int	&							operator[] (int const index)
									{
										return m_data[index];
									}

	bool							operator== (Point2 const &rhs)
									{
										return ((m_data[X] == rhs[X]) && (m_data[Y] == rhs[Y]));
									}

	void							Serialise(Json::Value * o_root) const
									{
									}

	void							Deserialise(Json::Value const * i_root)
									{
										m_data[X] = (*i_root)[X].asInt();
										m_data[Y] = (*i_root)[Y].asInt();
									}

protected:

private:

	int								m_data[2];
};

//-----------------------------------------------------------------------------
#endif // POINT2_H_INCLUDED_90293088